package com.example.demo.controller;

import com.example.demo.domain.dto.Email;
import com.example.demo.domain.dto.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;

/**
 * @Description :
 * @Author : Bruce Lee
 * @CreateTime : 2024/3/27
 */

@RequestMapping
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public void register(@RequestBody User user){
        userService.register(user);
    }


    @GetMapping("sendEmail")
    public void sendMail(){
        Email email = new Email();
        email.setSender("Bruce");
        email.setReceiver("Lee");
        userService.sendMail(email);
    }
}
